package com.yinile.zc03.domain;

import java.util.ArrayList;
import java.util.List;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;

import io.swagger.annotations.ApiModelProperty;
import java.math.BigDecimal;
import java.sql.Timestamp;


@Entity
@Table(schema="db1", name="t_author")
public class Author {
	@Id
	@Column(name="c_id",length=100)
	private String id;
	
	@Column(name="c_name",length=20)
	private String name;
	
	@Column(name="c_address",length=45)
	private String address;

	@Column(name="c_birthday")
	@ApiModelProperty(example="1481770165015")
	private Timestamp birthday;
	
	@Column(name="c_is_vip")
	private Boolean isVip;
	
	// decimal(9,3)
	@Column(name="c_balance", precision=9, scale=3)
	private BigDecimal balance;
	
	@Column(name="c_level")
	private Integer level;
	
	@Transient
	private List<Book> bookList = new ArrayList<Book>();
	
	public Author() {
		super();
	}

	public Author(String id, String name, String address) {
		super();
		this.id = id;
		this.name = name;
		this.address = address;
	}

	
	public Boolean getIsVip() {
		return isVip;
	}

	public void setIsVip(Boolean isVip) {
		this.isVip = isVip;
	}

	public Integer getLevel() {
		return level;
	}

	public void setLevel(Integer level) {
		this.level = level;
	}

	public String getId() {
		return id;
	}

	public BigDecimal getBalance() {
		return balance;
	}

	public void setBalance(BigDecimal balance) {
		this.balance = balance;
	}

	public void setId(String id) {
		this.id = id;
	}

	public Timestamp getBirthday() {
		return birthday;
	}

	public void setBirthday(Timestamp birthday) {
		this.birthday = birthday;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public List<Book> getBookList() {
		return bookList;
	}

	public void setBookList(List<Book> bookList) {
		this.bookList = bookList;
	}

}
